<?php namespace Zm345\Com\SDK\OpenLib\Copen\Enterpr\Order;use Zm345\Com\SDK\OpenLib\Copen\AQueryCopen;class ShoppingCartAdd extends AQueryCopen{protected$apiParams=[];public function setMemberId($id){$this->apiParams['member_id']=$this->db->quote($id);return$this;}public function setDetailJson($data){if(is_array($data))$data=json_encode($data,JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE);$this->apiParams['detail_json']=$this->db->quote($data);return$this;}public function check(){$lackFieldParts=[];if(!isset($this->apiParams['member_id']))$lackFieldParts[]='member_id';if($lackFieldParts){$this->errorCode='error-param';$this->errorInfo='缺少初始化参数:'.implode(',',$lackFieldParts);return false;}return true;}public function getQueryStr(){$queryStr='REPLACE INTO '.$this->tbPrefix.'enterpr_shopping_cart SET ';$valParts=[];foreach($this->apiParams as$name=>$val){$valParts[]="$name=$val";}$this->apiParams=[];return$queryStr.implode(',',$valParts).';';}}?>